package com.example.mybatisplus.web.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.example.mybatisplus.common.JsonResponse;
import com.example.mybatisplus.service.HotelService;
import com.example.mybatisplus.model.domain.Hotel;

import java.util.List;


/**
 *
 *  前端控制器
 *
 *
 * @author blue
 * @since 2022-01-07
 * @version v1.0
 */
@RestController
@RequestMapping("/api/hotel")
public class HotelController {

    private final Logger logger = LoggerFactory.getLogger( HotelController.class );

    @Autowired
    private HotelService hotelService;

    //查询
    @RequestMapping("/refer")
    public JsonResponse refer() {
        List<Hotel> hotels = hotelService.list();
        return JsonResponse.success(hotels);
    }

}
